<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : newsDetail.xsl
    Created on : Ngày 26 tháng 3 năm 2013, 23:03
    Author     : skunk
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
    <xsl:param name="detailID"/>

    <!-- TODO customize transformation rules
         syntax recommendation http://www.w3.org/TR/xslt
    -->
    <xsl:template match="/">
        <xsl:for-each select="//new[normalize-space(ID)=$detailID]">
            <div align="center">
                <table border ="0" width = "70%" style = "border:2px dotted black; border-collapse:collapse" >
                    <tr align="center" style="background-color:white">
                        <td colspan="2" style="font-size:20px;font-weight: bold">
                            <div style="margin-left:20px; margin-right:20px; margin-top:10px; margin-bottom:10px">
                                <xsl:value-of select = "title"/>
                            </div>
                        </td>
                    </tr>
                    <tr align="center" style="background-color:white">
                        <td >
                            <div style="margin-left:20px; margin-right:20px; margin-top:10px; margin-bottom:10px">
                                <img width ="500px">
                                    <xsl:attribute name="src">
                                        <xsl:value-of select="image"/>
                                    </xsl:attribute>
                                </img>
                            </div>
                        </td>
                    </tr>
                    <xsl:for-each select="//newDetail[normalize-space(newID)=$detailID]">
                    <tr align="left" style="background-color:white" >
                        <td>
                            <div style="margin-left:20px; margin-right:20px; margin-top:20px; margin-bottom:20px">
                                <xsl:value-of select="paragrap"/>
                            </div>
                        </td>
                    </tr>
                    </xsl:for-each>
                    <tr align="left" style="background-color:white" >
                        <td>
                            <div style="margin-left:20px; margin-right:20px; margin-top:10px; margin-bottom:10px">
                        Nguồn:
                                <xsl:value-of select="closing"/>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>
